

import yagmail,HTMLTestRunner_PY3


class Tools():

    # 生成测试报告的方法
    def Report(self):
        report = HTMLTestRunner_PY3.HTMLTestRunner(open('mqk.html','wb'),
                                                   title='孟勤凯6.17月考测试报告',
                                                   description='三条UI自动化测试执行脚本')
        return report

    # 发送邮件的方法
    def send_email(self):
        email = yagmail.SMTP(user='1229623302@qq.com',password='rkjwmduntxgmbacg',host='smtp.qq.com')
        email.send(to='1229623302@qq.com',subject='孟勤凯的邮箱',contents=['孟勤凯月考邮箱','mqk.html'])
        email.close()
